<?php include 'application/views/header.php' ?>
<?php include 'application/views/left.php' ?>

<!-- BOX NEWS -->
<div class="content-box user-change-password">
    <div class="title">
        <div class="label">Thông tin của người dùng</div>
        <div class="end-title"></div>
    </div>
    <!-- content -->
    <div class="user-change-password-content clr">
        <?php if($this->session->flashdata('message') != ''): ?>
            <div class="flash-message <?php echo $this->session->flashdata('class_message') ?>"><?php echo $this->session->flashdata('message'); ?></div>
        <?php endif; ?>
        
        <form action="#" id="frmChangePassword" method="post">
            <table width="80%">
                <tr>
                    <td>Mật khẩu cũ</td>
                    <td><input type="password" value="" name="oldPass" id="oldPass"/></td>
                </tr>
                <tr>
                    <td>Mật khẩu mới</td>
                    <td><input type="password" value="" name="newPass" id="newPass"/></td>
                </tr>
                <tr>
                    <td>Nhập lại mật khẩu</td>
                    <td><input type="password" value="" name="reNewPass" id="reNewPass"/></td>
                </tr>
            </table>
            <div class="button-set">
                <input type="submit" id="btnChangePassword" name="btnChangePassword" value="Thay đổi mật khẩu"/>
            </div>
        </form>
    </div>
</div>

<?php include 'application/views/right.php' ?>
<?php include 'application/views/footer.php' ?>
<script>
    $('#btnEdit').click(function(){
        window.location.href = '<?php echo base_url() ?>user/edit';
    });
    
    //validate form for change password
    $('#frmChangePassword').validate({
        rules: {
            oldPass : 'required',
            newPass : 'required',
            reNewPass : 'required'
        },
        messages: {
            oldPass : '',
            newPass : '',
            reNewPass : {
                required : true
            }
        }
    })
</script>